package homework12;

import java.util.Scanner;

public class Area {
	Scanner input = new Scanner(System.in);
	String choose;
	
	public void mainMenu() {
		System.out.println("选择你要计算的图形：\n1.三角形  2.圆形  3.正方形");
	    	}
	
	public void triangleArea() {
		System.out.println("请输入底的长度：");
		double base = input.nextDouble();
		System.out.println("请输入高的长度：");
	    double height = input.nextDouble();
	    double trianglearea = (base*height)/2;
	    System.out.println(trianglearea);
	}
	
	public void roundArea() {
		System.out.println("请输入半径：");
		double radius = input.nextDouble();
		double pi=3.1415926;
		double roundarea = pi*radius*radius;
		System.out.println(roundarea);
	}
	
	public void squareArea() {
		System.out.println("请输入边长：");
		double length = input.nextDouble();
		double squarearea = length*length;
		System.out.println(squarearea);
	}
	    }

